package com.c1g19.action.guide;

import com.c1g19.action.BaseAction;

import com.c1g19.service.guide.GuideService;
import com.c1g19.utils.ConstCommon;
import com.c1g19.utils.MD5Util;
import com.c1g19.utils.Struts2Utils;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import java.util.List;

import java.util.Map;

/**
 * 该类用以处理3D导览的操作
 * Created by Mr_C on 2017/3/7.
 */
public class GuideAction extends BaseAction{
    private static final long serialVersionUID = 1L;
    private static final Logger logger = Logger.getLogger(GuideAction.class);

    public int picture_id;

    /**
     * getter and setter
     */
    public int getPicture_id() {
        return picture_id;
    }

    public void setPicture_id(int picture_id) {
        this.picture_id = picture_id;
    }

    /**
     * 3D导览预处理操作---跳转到3D导览页面
     * @return
     */
    public String pre3DGuide(){
        logger.info("进入3D导览模块");
        return "success";
    }
    public String pre3DModelGuide(){
        logger.info("进入3D导览模块");
        return "success";
    }
    public String preimageGuide(){
        logger.info("进入图片导览模块");
        return "success";
    }


    public String goIntoOffice(float x, float y){
        return null;
    }

    /**
     * 获得所有的主导览图片
     */
    public void getAllMainPicture(){
        GuideService guideService = new GuideService();
        Map<String, Object> allMainPictureList = guideService.getAllMainPicture();


        //发给网页执行操作
        String resultJsonString = changeListToJsonStringWithJtable(allMainPictureList);
        Struts2Utils.renderJson(resultJsonString);
    }

    /**
     * 通过图片ID获得诊室定位
     */
    public void getPositionwithID(){

        GuideService guideService = new GuideService();
        Map<String, Object> positionList = guideService.getPositionwithID(picture_id);

        //发给网页执行操作
        String resultJsonString = changeListToJsonStringWithJtable(positionList);
        Struts2Utils.renderJson(resultJsonString);
    }
}
